import {NgModule} from '@angular/core';
import {CommonModule, DatePipe} from '@angular/common';
import {FormsModule, ReactiveFormsModule} from '@angular/forms';

import {NzIconModule} from 'ng-zorro-antd/icon';
import {AlertFill} from '@ant-design/icons-angular/icons';
import {IconDefinition} from '@ant-design/icons-angular';
import {DemoNgZorroAntdModule} from '../../NG-ZORRO/ng-zorro-antd.module';

import {SellRoutingModule} from './sell-routing.module';

import {SellCouponComponent} from './sell-coupon/sell-coupon.component';
import {SellDetailComponent} from './sell-detail/sell-detail.component';
import {SellSaveComponent} from './sell-save/sell-save.component';
import {SellUserCouponComponent} from './sell-user-coupon/sell-user-coupon.component';
import {SellAdComponent} from './sell-ad/sell-ad.component';
import {SellAdPositionComponent} from './sell-ad-position/sell-ad-position.component';
import {SellInviteComponent} from './sell-invite/sell-invite.component';
import {SellAdPositionSaveComponent} from './sell-ad-position-save/sell-ad-position-save.component';
import {SellAdSaveComponent} from './sell-ad-save/sell-ad-save.component';
import {SellInviteSaveComponent} from './sell-invite-save/sell-invite-save.component';
import {
  couponEditStatusPipe,
  uptoTimeStatusPipe,
  currentStatusPipe,
  channelStatusPipe,
  businessStatusPipe,
  ConnectLineStatePipe,
  ReturnStatusPipe,
  PrizeStatusPipe,
  PlaceStatusPipe,
  ChangeCodeStatusPipe,
  RecoveryMarkupStatusPipe
} from './status.pipe';
import {
  StateStatusPipe,
  ActivityTypeStatusPipe,
  OrderStateStatusPipe,
  OrderColorStatus
} from './sell-promotion-manage/promotion-status.pipe';

// 封装组件module
import {sharedModule} from '../../sharedModule/shared.module';
import {SellCouponbagManageComponent} from './sell-couponbag-manage/sell-couponbag-manage.component';
import {SellCouponbagHandleComponent} from './sell-couponbag-handle/sell-couponbag-handle.component';
import {DirectDescentManageComponent} from './sell-promotion-manage/direct-descent-manage/direct-descent-manage.component';
import {DirectDescentRecordComponent} from './sell-promotion-manage/direct-descent-record/direct-descent-record.component';
import {FollowupModelComponent} from './sell-promotion-manage/components/followup-model/followup-model.component';
import {DirectDescentDetailsComponent} from './sell-promotion-manage/direct-descent-details/direct-descent-details.component';
import {DirectDescentAddeditComponent} from './sell-promotion-manage/direct-descent-addedit/direct-descent-addedit.component';
import {DeliveryActivitiesComponent} from './sell-delivery-activities/sell-delivery-activities.component';
import {OrderLotteryListComponent} from './sell-luckdraw-manage/order-lottery-list/order-lottery-list.component';
import {OrderLotteryConfigComponent} from './sell-luckdraw-manage/order-lottery-config/order-lottery-config.component';
import {OrderLotteryRecordComponent} from './sell-luckdraw-manage/order-lottery-record/order-lottery-record.component';
import {SellChangecodeRecordComponent} from './sell-changecode-record/sell-changecode-record.component';
import {PageDecorationComponent} from './page-decoration/page-decoration.component';
import {DecorationComponent} from './page-decoration/decoration/decoration.component';
import {ImagesComponent} from './page-decoration/decoration/component/images/images.component';
import {LoopImagesComponent} from './page-decoration/decoration/component/loop-images/loop-images.component';
import {GoodsComponent} from './page-decoration/decoration/component/goods/goods.component';
import {UsedGoodsComponent} from './page-decoration/decoration/component/used-goods/used-goods.component';
import {TopTabComponent} from './page-decoration/decoration/component/top-tab/top-tab.component';
import {BottomTabComponent} from './page-decoration/decoration/component/bottom-tab/bottom-tab.component';

const icons: IconDefinition[] = [AlertFill];

const pipeArrs: any = [
  couponEditStatusPipe,
  channelStatusPipe,
  businessStatusPipe,
  uptoTimeStatusPipe,
  currentStatusPipe,
  StateStatusPipe,
  OrderStateStatusPipe,
  OrderColorStatus,
  ActivityTypeStatusPipe,
  ConnectLineStatePipe,
  ReturnStatusPipe,
  PrizeStatusPipe,
  PlaceStatusPipe,
  ChangeCodeStatusPipe,
  RecoveryMarkupStatusPipe
];

@NgModule({
  declarations: [
    ...pipeArrs,
    SellCouponComponent,
    SellDetailComponent,
    SellSaveComponent,
    SellUserCouponComponent,
    SellAdComponent,
    SellAdPositionComponent,
    SellInviteComponent,
    SellAdSaveComponent,
    SellAdPositionSaveComponent,
    SellInviteSaveComponent,
    SellCouponbagManageComponent,
    SellCouponbagHandleComponent,
    DirectDescentManageComponent,
    DirectDescentRecordComponent,
    FollowupModelComponent,
    DirectDescentDetailsComponent,
    DirectDescentAddeditComponent,
    DeliveryActivitiesComponent,
    OrderLotteryListComponent,
    OrderLotteryConfigComponent,
    OrderLotteryRecordComponent,
    SellChangecodeRecordComponent,
    PageDecorationComponent,
    DecorationComponent,
    ImagesComponent,
    LoopImagesComponent,
    GoodsComponent,
    UsedGoodsComponent,
    TopTabComponent,
    BottomTabComponent
  ],
  imports: [
    sharedModule,
    DemoNgZorroAntdModule,
    NzIconModule.forRoot(icons),
    ReactiveFormsModule,
    FormsModule,
    CommonModule,
    SellRoutingModule,
  ],
  providers: [DatePipe]
})
export class SellModule {
}
